﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新闻中心</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="js/jquery.js"></script>
<script src="js/cloud.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery-1.6.3.min.js"></script>
<script language="javascript">
	$(function(){
		$('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
		$(window).resize(function(){  
		$('.loginbox').css({'position':'absolute','left':($(window).width()-692)/2});
    })  
});  
</script> 

</head>

<body style="background-color:#1c77ac; background-image:url(images/light.png); background-repeat:no-repeat; background-position:center top; overflow:hidden;">

    <div id="mainBody">
      <div id="cloud1" class="cloud"></div>
      <div id="cloud2" class="cloud"></div>
    </div>  

    
    <div class="loginbody">
    
    <span class="systemlogo" style="margin-top:60px;"></span> 
       
    <div class="loginbox loginbox1">
    <ul>
    <li><input name="" type="text" class="loginuser"  name="username" id="username"/></li>
    <li><input name="" type="password" class="loginpwd"   name="password" id="password"/></li>
    <li class="yzm">
    <span><input name="" type="text" value="验证码" id="code_num" onclick="JavaScript:this.value=''"/></span><cite><img id="refresh" src="yzm.php" onClick="this.src='yzm.php?r='+Math.random()"/></cite> 
    </li>
    <li><input name="" type="button"  class="loginbtn" value="登录"  onclick="ok()" /><label><input name="" type="button" class="loginbtn" value="重置"  onclick="cz()" /></label></li>
    </ul>
    </div>
    
    </div>
    
    <div class="loginbm">版权所有  2015   深圳云盾新闻中心</div>
	
</body>
</html>

<script>

    function ok(){
		   //开始验证验证码是否输入正确
		    var code_num=$("#code_num").val().toUpperCase();
		    var username=$("#username").val();
		    var password=$("#password").val();
			
			//alert(code_num);
			//var dd="<?php session_start();echo $_SESSION["freejs_num"];file_put_contents("/var/www/html/2.conf","3:".$_SESSION["freejs_num"]."\n",FILE_APPEND );?>"
			$.post("check_yzm.php",function(data){
				
				if(code_num==data){
					//验证码输入正确
					 window.location.href="login_commit.php?username="+username+"&password="+password;
				}else{
					//请重新输入验证码
					alert("验证码错误");
				    $("#code_num").val();
				    $("#refresh").attr('src','yzm.php?r='+Math.random());
    				}
				//window.location.href="login_commit.php?username="+username+"&password="+password;
			//}else{
				//alert("验证码错误");
				//location.reload();
				
			//} 
		});
	}

	function yzm(){
		
	    $.post("4.php",{},function(data){
			alert(data);
			
		});
		
	}


</script>